package com.dgut.usermanager.service;

import com.dgut.usermanager.dao.ImageDao;
import com.dgut.usermanager.entity.Image;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class ImageServiceImp implements ImageService{

    @Autowired
    ImageDao imageDao;

    @Override
    public Image findImageByUserId(Integer userId) {
        return imageDao.findImageByUserId(userId);
    }

    @Override
    public Image AddImage(Image image) {
        return imageDao.save(image);
    }

    @Override
    public Image updateImage(Image image) {
        return imageDao.save(image);
    }

    @Override
    public void deleteImageByUserId(Integer userId) {
        imageDao.deleteImageByUserId(userId);

    }
}
